#ifndef __STHREAD__
#define __STHREAD__

#ifdef LINUX
#include <pthread.h>
#endif

#define Sthread_Head int

class Sthread_Initial {
private:
    //Gssapi_Tsd tsd;

public:
    Sthread_Initial() {}
    //Gssapi_Tsd* getGTsd() {return &tsd}
    virtual ~Sthread_Initial() {}
    virtual void start(void) = 0;
};

class Sthread {

#ifdef WIN32
private:
    static DWORD *win32ThreadIdTbl;
    static ulong nWin32Threads;
    unit Lookup(DWORD win32ThreadId);
#endif /* WIN32 */

#ifdef LINUX
private:
    static pthread_key_t cbkpThreadNumKey;
    static uint nLinuxThreads;
#endif /* LINUX */

public:
  // constructor
  Sthread(const char *nameStr, Sthread_Head *free_q = 0, unsigned stk_size = 1024);
  void startThread(Sthread_Initial *i);
  void suicide();
  void yield();
  uint tag();
};

extern Sthread* Sthread_self(void);

#endif
/* END of FILE  sthread.h */

    
